package com.cskaoyan.bean.common;

import lombok.Data;

/**
 * @author zhangYun
 * @since 2023/01/02 16:58
 */
@Data
public class ZYBaseVO {
    private String errmsg;
    private int errno;

    public static ZYBaseVO success() {
        ZYBaseVO zyBaseVO = new ZYBaseVO();
        zyBaseVO.setErrmsg(Constant.SUCCESS);
        return zyBaseVO;
    }

    public static ZYBaseVO success(String msg) {
        ZYBaseVO zyBaseVO = new ZYBaseVO();
        zyBaseVO.setErrmsg(msg);
        return zyBaseVO;
    }

    public static ZYBaseVO exception(String dbException) {
        ZYBaseVO zyBaseVO = new ZYBaseVO();
        zyBaseVO.setErrmsg(dbException);
        zyBaseVO.setErrno(Constant.EXCEPTION_CODE);
        return zyBaseVO;
    }
}
